////
//// Source code recreated from a .class file by IntelliJ IDEA
//// (powered by Fernflower decompiler)
////
//
//package com.example.testhiber.initPackage.config.controller;
//
//import com.example.testhiber.initPackage.business.utils.StringKit;
//import org.springframework.web.bind.WebDataBinder;
//import org.springframework.web.bind.annotation.InitBinder;
//import org.springframework.web.servlet.mvc.AbstractController;
//import simple.system.simpleweb.platform.util.datetime.DateTimeKit;
//import simple.system.simpleweb.platform.util.datetime.DateTimeKit.DateStyle;
//import simple.system.simpleweb.platform.web.editor.DoubleEditor;
//import simple.system.simpleweb.platform.web.editor.FloatEditor;
//import simple.system.simpleweb.platform.web.editor.IntegerEditor;
//import simple.system.simpleweb.platform.web.editor.LongEditor;
//
//import java.beans.PropertyEditorSupport;
//import java.util.Date;
//
//public abstract class SimplewebBaseController extends AbstractController {
//    public SimplewebBaseController() {
//    }
//
//    @InitBinder
//    protected void initBinder(WebDataBinder binder) {
//        binder.registerCustomEditor(Date.class, new DateEditor());
//        binder.registerCustomEditor(Long.TYPE, new LongEditor());
//        binder.registerCustomEditor(Double.TYPE, new DoubleEditor());
//        binder.registerCustomEditor(Float.TYPE, new FloatEditor());
//        binder.registerCustomEditor(Integer.TYPE, new IntegerEditor());
//        binder.registerCustomEditor(Boolean.TYPE, new BooleanEditor());
//    }
//
//    private class BooleanEditor extends PropertyEditorSupport {
//        private BooleanEditor() {
//        }
//
//        public void setAsText(String text) {
//            Boolean value = Boolean.FALSE;
//            if (!StringKit.isEmpty(text)) {
//                value = "1".equals(text) || "true".equals(text);
//            }
//
//            this.setValue(value);
//        }
//    }
//
//    private class DateEditor extends PropertyEditorSupport {
//        private DateEditor() {
//        }
//
//        public void setAsText(String text) {
//            DateStyle dateStyle = DateTimeKit.getDateStyle(text);
//            Date value = DateTimeKit.stringToDate(text, dateStyle);
//            this.setValue(value);
//        }
//    }
//}
